<template>
  <view class="page">
    <view class="page-bd">
      <view class="result">
        <view class="result-info">
          <view class="icon m-b--m">
            <view class="iconfont icon-a-32_32_fill_check"></view
          ></view>
          <view class="text">{{ msg }}</view>
        </view>
        <view class="buttons-area">
          <view class="ui-button button-style--primary button-size--large"
            @tap="handleGoDetail"
            >单据详情</view
          >
          <view class="ui-button button-style--default button-size--large"
            @tap="handleGoList"
            >单据列表</view
          >
          <view class="ui-button button-style--default button-size--large"
          @tap="handleGoHome"
            >返回首页</view
          >
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
import { ROUTE } from '@/constant/constant';
import { onLoad } from '@dcloudio/uni-app';

const { proxy } = getCurrentInstance();
const from = ref('submit');
const data = reactive({
  msg: '盘点提交成功',
  orderDetailUrl: 'url',
  orderListUrl: 'url',
});

const msg = computed(() => {
  return from.value ==='saveTheDraft' ? '草稿保存成功' : '盘点提交成功';
})

const handleGoHome = () => {
  proxy.$tab.navigateTo(ROUTE.HOME);
}

const handleGoList = () => {
  proxy.$tab.navigateTo(ROUTE.PAGE_APPS.COUNT_TASK);
}

const handleGoDetail = () => {
  proxy.$tab.navigateTo(ROUTE.PAGE_APPS.PARTIAL_COUNT_DETAIL);
}

onLoad((options) => {
  if (options.from === 'saveTheDraft') {
    from.value = 'saveTheDraft';
  }
})

</script>

<style scoped lang="scss">
@import "@/static/scss/theme.scss";

.page {
  height: 100vh;
  background-color: #F4F8FB;
  // padding: 16rpx 24rpx;
  display: flex;
  flex-direction: column;

  &-bd {
    display: flex;
    height: 644rpx;
    justify-content: center;
    align-items: center;
    background-color: #fff;
  }
  .result {
    width: 360rpx;

    &-info {
      margin-bottom: 60rpx;
      .icon {
        color: $primary-color;
        display: flex;
        justify-content: center;
        .iconfont {
          font-size: 72rpx;
        }
      }
      .text {
        font-size: 30rpx;
        font-style: normal;
        font-weight: 500;
        line-height: 48rpx;
        text-align: center;
      }
    }

    .buttons-area {
      display: flex;
      flex-direction: column;
      gap: 24rpx;
    }
  }
}
</style>
